/* 基础样式 */
:root {
    --primary-color: #0066cc;
    --primary-light: #4d94ff;
    --primary-dark: #004c99;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --error: #dc3545;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

/* 布局 */
main {
    margin-left: 80px;
    padding: 20px 30px;
}

.content {
    margin-left: 80px;
    padding: 20px 30px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--text-primary);
}

/* 侧边导航栏 */
.side-nav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background-color: var(--bg-primary);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.side-nav ul {
    list-style: none;
    width: 100%;
}

.side-nav li {
    margin-bottom: 16px;
    width: 100%;
}

.side-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.side-nav a:hover, .side-nav a.active {
    color: var(--primary-color);
    background-color: rgba(0, 102, 204, 0.05);
}

.side-nav img {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.side-nav span {
    font-size: 12px;
}

/* 顶部导航栏 */
header {
    background-color: var(--bg-primary);
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    margin-left: 80px;
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    gap: 20px;
}

nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

nav a.active, nav a:hover {
    color: var(--primary-color);
    background-color: rgba(0, 102, 204, 0.05);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: var(--primary-dark);
}

.btn.secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn.secondary:hover {
    background-color: #e9ecef;
}

.btn.small {
    padding: 6px 12px;
    font-size: 12px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
}

.secondary-btn {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.secondary-btn:hover {
    background-color: #e9ecef;
}

.danger-btn {
    background-color: var(--error);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.danger-btn:hover {
    background-color: #c82333;
}

/* 首页样式 */
.hero {
    background-color: #e6f2ff;
    padding: 60px 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 40px;
}

.hero h2 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.hero p {
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto 30px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.features {
    margin-bottom: 40px;
}

.features h2, .destinations h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 30px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.feature-card {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.destination-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.destination-card {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.destination-card h3 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.destination-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.package-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.coming-soon {
    opacity: 0.7;
}

.eta {
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 12px;
}

.loading, .error {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.error {
    color: var(--error);
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    margin-top: 40px;
    font-size: 14px;
    margin-left: 80px;
}

/* 文化知识库页面样式 */
.culture-search {
    display: flex;
    margin-bottom: 30px;
    max-width: 800px;
}

.culture-search input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    font-size: 16px;
}

.culture-search button {
    border-radius: 0 8px 8px 0;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.culture-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.category-card img {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.category-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.category-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

.culture-content-area {
    min-height: 400px;
    margin-bottom: 40px;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.culture-result-card {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.culture-result-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.culture-content-text {
    margin-bottom: 30px;
    line-height: 1.8;
}

.culture-content-text p {
    margin-bottom: 16px;
}

.culture-actions {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.popular-queries {
    margin-top: 40px;
}

.popular-queries h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.query-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.query-tag {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.query-tag:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.error-message {
    background-color: #FEF2F2;
    border: 1px solid #F87171;
    border-radius: 8px;
    padding: 20px;
    color: #B91C1C;
    text-align: center;
}

.error-message p {
    margin-bottom: 16px;
}

/* 地图页面样式 */
.map-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.map-sidebar {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.map-search {
    display: flex;
    gap: 8px;
}

.map-search input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.map-filters h3, .nearby-places h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.nearby-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.nearby-item {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nearby-item:hover {
    background-color: #EDF2F7;
}

.nearby-item h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.nearby-item p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-btn {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.distance {
    font-size: 12px;
    color: var(--text-secondary);
}

.map-view {
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    background-color: #f0f0f0;
}

.place-info {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 320px;
    background-color: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 16px;
    z-index: 10;
    display: none;
}

.place-info.show {
    display: block;
}

.place-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.place-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.place-content {
    margin-bottom: 16px;
}

.culture-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.culture-info h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.place-actions {
    display: flex;
    gap: 8px;
}

.no-result, .error-msg {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
}

.error-msg {
    color: var(--error);
}

/* 设置页面样式 */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.settings-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    flex: 1;
}

.setting-label h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.setting-label p {
    font-size: 14px;
    color: var(--text-secondary);
}

.setting-control {
    min-width: 120px;
    display: flex;
    justify-content: flex-end;
}

.setting-control select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-primary);
    font-size: 14px;
    min-width: 120px;
}

/* 开关样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* 离线内容页面样式 */
.destination-selector {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.destination-selector h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.search-box {
    display: flex;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.search-box button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 0 12px;
    cursor: pointer;
}

.popular-destinations h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.destination-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.destination-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.destination-card:hover {
    background-color: #EDF2F7;
}

.destination-card.selected {
    background-color: var(--primary-color);
    color: white;
}

.destination-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    main, .content {
        margin-left: 0;
        padding: 16px;
    }
    
    header {
        margin-left: 0;
    }
    
    .side-nav {
        bottom: 0;
        top: auto;
        width: 100%;
        height: 60px;
        flex-direction: row;
        padding: 0;
    }
    
    .side-nav ul {
        display: flex;
        justify-content: space-around;
        align-items: center;
        height: 100%;
    }
    
    .side-nav li {
        margin-bottom: 0;
        height: 100%;
    }
    
    .side-nav a {
        height: 100%;
        padding: 8px 0;
    }
    
    .side-nav img {
        margin-bottom: 2px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .feature-grid, .destination-grid {
        grid-template-columns: 1fr;
    }
    
    footer {
        margin-left: 0;
        margin-bottom: 60px;
    }
    
    .map-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .map-sidebar {
        order: 2;
        height: 200px;
    }
    
    .map-view {
        order: 1;
        height: calc(100vh - 360px);
    }
    
    .place-info {
        width: calc(100% - 32px);
        left: 16px;
        right: 16px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .setting-control {
        margin-top: 12px;
        width: 100%;
        justify-content: flex-start;
    }
    
    .setting-control select {
        width: 100%;
    }
}